<template>
  <ant-modal
    modalWidth="384"
    modalHeight="400"
    :visible="open"
    :modal-title="formTitle"
    :adjust-size="true"
    @cancel="cancel"
  >
    <a-form-model ref="form" :model="form" :rules="rules" slot="content" layout="vertical">
      <a-row :gutter="32">
        <a-col :span="24">
          <a-form-model-item label="仓库名称" prop="name">
            <a-input v-model="form.name" placeholder="请输入仓库名称"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="24">
          <a-form-model-item label="仓库地址" prop="address">
            <a-input v-model="form.address" placeholder="请输入仓库地址"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="24">
          <a-form-model-item label="面积" prop="area">
            <a-input v-model="form.area" placeholder="请输入面积"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="24" >
          <a-form-model-item label="所在地区" prop="areaname">
            <a-select
              placeholder="请选择所在地区"
              v-model="form.areaname"
              :getPopupContainer="
                triggerNode => {
                  return triggerNode.parentNode || document.body
                }
              "
              style="width: 100%"
              allow-clear>
              <a-select-option v-for="(d, index) in areanameOptions" :key="index" :value="d.dictValue">{{ d.dictLabel }}</a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
        <a-col :span="24">
          <a-form-model-item label="联系人" prop="contact">
            <a-input v-model="form.contact" placeholder="请输入联系人"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="24">
          <a-form-model-item label="联系方式" prop="telephone">
            <a-input v-model="form.telephone" placeholder="请输入联系方式"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="24">
          <a-form-model-item label="备注" prop="remark">
            <a-input v-model="form.remark" placeholder="请输入备注"/>
          </a-form-model-item>
        </a-col>
      </a-row>
    </a-form-model>
    <template slot="footer">
      <a-button :disabled="disabled" @click="cancel">
        取消
      </a-button>
      <a-button type="primary" :disabled="disabled" @click="submitForm(true)">
        保存
      </a-button>
    </template>
  </ant-modal>
</template>
<script>
import BaseWarehouseAddForm from './BaseWarehouseForm'
export default {
  ...BaseWarehouseAddForm
}
</script>
